var __extends =
    (this && this.__extends) ||
    (function () {
      var t = function (e, i) {
        return (t =
          Object.setPrototypeOf ||
          ({ __proto__: [] } instanceof Array &&
            function (t, e) {
              t.__proto__ = e;
            }) ||
          function (t, e) {
            for (var i in e)
              Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
          })(e, i);
      };
      return function (e, i) {
        function n() {
          this.constructor = e;
        }
        if ("function" != typeof i && null !== i)
          throw new TypeError(
            "Class extends value " + String(i) + " is not a constructor or null"
          );
        t(e, i),
          (e.prototype =
            null === i
              ? Object.create(i)
              : ((n.prototype = i.prototype), new n()));
      };
    })(),
  AXRecruitmentDialog = (function (t) {
    function e() {
      var e = t.call(this) || this;
      return (
        (e.jjlbd = !1),
        (e.djjlbd = !1),
        (e.usedRecruit = !1),
        (e.onLoadZhaoMuDataFn = {
          caller: e,
          code: 1387,
          method: function (t) {
            0 != t.code && ToastView.toastView(t.msg),
              t.msg && ToastView.toastView(t.msg),
              t.data &&
                (e.generalArr.unshift(t.data),
                e.showGeneralListView(),
                (e.usedRecruit = !0),
                WebSocketService.send({ c: 1200, d: null }));
          },
        }),
        (e.onLoadRecruitmentDataFn = {
          caller: e,
          code: 1200,
          method: function (t) {
            if (0 == t.code) {
              var i = t.data.jjl + t.data.jjl_bd,
                n = t.data.djjl + t.data.djjl_bd;
              t.data.jjl_bd > 0 && (e.jjlbd = !0),
                t.data.djjl_bd > 0 && (e.djjlbd = !0),
                (e.label_jiangjunling_num.text = "( " + i + " )"),
                (e.label_dajiangjunling_num.text = "( " + n + " )"),
                (e.button_jiangjunling_zhaomu.visible = i > 0),
                (e.button_dajiangjunling_zhaomu.visible = n > 0);
            } else ToastView.toastView(t.msg);
          },
        }),
        WebSocketService.addListener(e.onLoadRecruitmentDataFn),
        e.button_jiangjunling_zhaomu.on(
          Laya.Event.CLICK,
          e,
          e.onZhaoMuJJLActionFn
        ),
        e.button_dajiangjunling_zhaomu.on(
          Laya.Event.CLICK,
          e,
          e.onZhaoMuJJLActionFn
        ),
        WebSocketService.addListener(e.onLoadZhaoMuDataFn),
        e
      );
    }
    return (
      __extends(e, t),
      (e.showRecruitmentOpen = function (t, i) {
        null == this.recruitment && (this.recruitment = new e()),
          this.recruitment.popup(),
          (this.recruitment.push_type = ""),
          (this.recruitment.generalArr = []),
          (this.recruitment.usedRecruit = !1),
          "1" == t
            ? ((this.recruitment.image_recruitment_zhaomufujiang.visible = !0),
              (this.recruitment.image_recruitment_fujiangshuoming.visible = !1),
              (this.recruitment.push_type = i),
              (this.recruitment.list_recruitItem.visible = !0))
            : ((this.recruitment.image_recruitment_zhaomufujiang.visible = !1),
              (this.recruitment.image_recruitment_fujiangshuoming.visible = !0),
              (this.recruitment.list_recruitItem.visible = !1),
              (this.recruitment.push_type = i)),
          WebSocketService.send({ c: 1200, d: null }),
          this.recruitment.showGeneralListView();
      }),
      (e.prototype.onZhaoMuJJLActionFn = function (t) {
        var e = 0;
        "item0" == t.target.name
          ? (e = this.jjlbd ? 153 : 68)
          : "item1" == t.target.name && (e = this.djjlbd ? 381 : 69),
          WebSocketService.send({ c: 1387, d: { gid: e } });
      }),
      (e.prototype.showGeneralListView = function () {
        for (var t, e = [], i = 0; i < this.generalArr.length; i++)
          (t =
            0 == i
              ? {
                  lable_item_recruit: {
                    text: this.generalArr[i],
                    color: "#7F4021",
                  },
                }
              : {
                  lable_item_recruit: {
                    text: this.generalArr[i],
                    color: "#444444",
                  },
                }),
            e.push(t);
        (this.list_recruitItem.dataSource = e),
          (this.list_recruitItem.vScrollBarSkin = ""),
          this.generalArr.length > 0 &&
            this.list_recruitItem.scrollTo(this.generalArr.length);
      }),
      (e.prototype.close = function (e) {
        this.usedRecruit &&
          ("AXWearableGoodView" == this.push_type
            ? WebSocketService.send({ c: 1425, d: { pageNum: 0 } })
            : "AXSubordinateView" == this.push_type &&
              WebSocketService.send({ c: 1119, d: null })),
          t.prototype.close.call(this, e);
      }),
      e
    );
  })(ui.SubSquareController.AXRecruitmentDialogUI);
